﻿// <copyright file="IEntityWriter.cs" company="City of Portland, BES-ASM">
// </copyright>
// <summary>IEntityWriter class</summary>

namespace BESASM.EMGAATS.DataAccess
{
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using BESASM.EMGAATS.BusinessClasses;

  /// <summary>
  /// An interface for writing and reading entities from a workspace.
  /// </summary>
  public interface IEntityWriter : IEntityReader
  {
    /// <summary>
    /// Deletes the given entity from the database.
    /// </summary>
    /// <param name="entity">The entity to delete.</param>
    void DeleteEntity(IEntity entity);

    /// <summary>
    /// Updates the record corresponding to the given entity with current property values.
    /// </summary>
    /// <param name="entity">The entity to update.</param>
    void UpdateEntity(IEntity entity);

    /// <summary>
    /// Adds a corresponding record for the given entity with current property values.
    /// </summary>
    /// <param name="entity">The entity to add.</param>
    /// <remarks>This may update the entity id.</remarks>
    void AddEntity(IEntity entity);
  }
}
